<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFrameworks>$(NetCoreAppCurrent);$(NetCoreAppPrevious);$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum)</TargetFrameworks>
    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
    <NoWarn>$(NoWarn);SA1205</NoWarn>
    <EnableTrimAnalyzer Condition="$([MSBuild]::GetTargetFrameworkIdentifier('$(TargetFramework)')) == '.NETFramework'">false</EnableTrimAnalyzer>
    <UseCompilerGeneratedDocXmlFile>false</UseCompilerGeneratedDocXmlFile>
    <IsPackable>true</IsPackable>
    <PackageDescription>Provides Classes that allow you to decouple code logging rich (unserializable) diagnostics/telemetry (e.g. framework) from code that consumes it (e.g. tools)

Commonly Used Types:
System.Diagnostics.DiagnosticListener
System.Diagnostics.DiagnosticSource</PackageDescription>
  </PropertyGroup>

  <!-- DesignTimeBuild requires all the TargetFramework Derived Properties to not be present in the first property group. -->
  <PropertyGroup>
    <DefineConstants Condition="$([MSBuild]::GetTargetFrameworkIdentifier('$(TargetFramework)')) == '.NETFramework'">$(DefineConstants);ENABLE_HTTP_HANDLER</DefineConstants>
    <DefineConstants Condition="$([MSBuild]::GetTargetFrameworkIdentifier('$(TargetFramework)')) == '.NETCoreApp'">$(DefineConstants);W3C_DEFAULT_ID_FORMAT;MEMORYMARSHAL_SUPPORT;OS_ISBROWSER_SUPPORT</DefineConstants>
    <IncludePlatformAttributes>true</IncludePlatformAttributes>
  </PropertyGroup>

  <ItemGroup>
    <ILLinkSubstitutionsXmls Include="ILLink/ILLink.Substitutions.Shared.xml" />
  </ItemGroup>

  <ItemGroup>
    <Compile Include="System\Diagnostics\Activity.cs" />
    <Compile Include="System\Diagnostics\Activity.Current.net46.cs" />
    <Compile Include="System\Diagnostics\ActivityStatusCode.cs" />
    <Compile Include="System\Diagnostics\ActivityTagsCollection.cs" />
    <Compile Include="System\Diagnostics\ActivityContext.cs" />
    <Compile Include="System\Diagnostics\ActivityCreationOptions.cs" />
    <Compile Include="System\Diagnostics\ActivitySamplingResult.cs" />
    <Compile Include="System\Diagnostics\ActivityEvent.cs" />
    <Compile Include="System\Diagnostics\ActivityKind.cs" />
    <Compile Include="System\Diagnostics\ActivityLink.cs" />
    <Compile Include="System\Diagnostics\ActivityListener.cs" />
    <Compile Include="System\Diagnostics\ActivitySource.cs" />
    <Compile Include="System\Diagnostics\DiagnosticSource.cs" />
    <Compile Include="System\Diagnostics\DiagnosticSourceActivity.cs" />
    <Compile Include="System\Diagnostics\DiagnosticListener.cs" />
    <Compile Include="System\Diagnostics\DiagnosticSourceEventSource.cs" />
    <Compile Include="System\Diagnostics\DiagLinkedList.cs" />
    <Compile Include="System\Diagnostics\DistributedContextPropagator.cs" />
    <Compile Include="System\Diagnostics\LegacyPropagator.cs" />
    <Compile Include="System\Diagnostics\NoOutputPropagator.cs" />
    <Compile Include="System\Diagnostics\PassThroughPropagator.cs" />
    <Compile Include="System\Diagnostics\RandomNumberGenerator.cs" />
    <Compile Include="System\Diagnostics\Metrics\AggregationManager.cs" />
    <Compile Include="System\Diagnostics\Metrics\Aggregator.cs" />
    <Compile Include="System\Diagnostics\Metrics\AggregatorStore.cs" />
    <Compile Include="System\Diagnostics\Metrics\Counter.cs" />
    <Compile Include="System\Diagnostics\Metrics\ExponentialHistogramAggregator.cs" />
    <Compile Include="System\Diagnostics\Metrics\Histogram.cs" />
    <Compile Include="System\Diagnostics\Metrics\IMeterFactory.cs" />
    <Compile Include="System\Diagnostics\Metrics\Instrument.cs" />
    <Compile Include="System\Diagnostics\Metrics\Instrument.common.cs" />
    <Compile Include="System\Diagnostics\Metrics\InstrumentState.cs" />
    <Compile Include="System\Diagnostics\Metrics\LastValueAggregator.cs" />
    <Compile Include="System\Diagnostics\Metrics\Measurement.cs" />
    <Compile Include="System\Diagnostics\Metrics\Meter.cs" />
    <Compile Include="System\Diagnostics\Metrics\MeterFactoryExtensions.cs" />
    <Compile Include="System\Diagnostics\Metrics\MeterListener.cs" />
    <Compile Include="System\Diagnostics\Metrics\MetricsEventSource.cs" />
    <Compile Include="System\Diagnostics\Metrics\MeterOptions.cs" />
    <Compile Include="System\Diagnostics\Metrics\ObjectSequence.cs" />
    <Compile Include="System\Diagnostics\Metrics\ObservableCounter.cs" />
    <Compile Include="System\Diagnostics\Metrics\ObservableGauge.cs" />
    <Compile Include="System\Diagnostics\Metrics\ObservableInstrument.cs" />
    <Compile Include="System\Diagnostics\Metrics\ObservableUpDownCounter.cs" />
    <Compile Include="System\Diagnostics\Metrics\CounterAggregator.cs" />
    <Compile Include="System\Diagnostics\Metrics\StringSequence.cs" />
    <Compile Include="System\Diagnostics\Metrics\TagList.cs" />
    <Compile Include="System\Diagnostics\Metrics\UpDownCounter.cs" />

    <Compile Include="$(CommonPath)Internal\Padding.cs" Link="Common\Internal\Padding.cs" />
    <Compile Include="$(CommonPath)System\HexConverter.cs" Link="Common\System\HexConverter.cs" />
    <Compile Include="$(CommonPath)System\Diagnostics\DiagnosticsHelper.cs" Link="Common\System\Diagnostics\DiagnosticsHelper.cs" />

    <None Include="DiagnosticSourceUsersGuide.md" />
    <None Include="ActivityUserGuide.md" />
  </ItemGroup>

  <ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'">
    <Compile Include="System\Diagnostics\Activity.GenerateRootId.netcoreapp.cs" />
    <Compile Include="System\Diagnostics\ActivityContext.netcoreapp.cs" />
    <Compile Include="System\Diagnostics\ActivityLink.netcoreapp.cs" />
    <Compile Include="System\Diagnostics\LocalAppContextSwitches.cs" />
    <Compile Include="System\Diagnostics\Metrics\Instrument.netcore.cs" />
    <Compile Include="System\Diagnostics\Metrics\ObjectSequence.netcore.cs" />
    <Compile Include="System\Diagnostics\Metrics\StringSequence.netcore.cs" />
    <Compile Include="System\Diagnostics\System.Diagnostics.DiagnosticSource.Typeforwards.netcoreapp.cs" />
    <Compile Include="$(CommonPath)System\LocalAppContextSwitches.Common.cs"
             Link="Common\System\LocalAppContextSwitches.Common.cs" />
    <Compile Include="$(CommonPath)System\Text\ValueStringBuilder.cs"
             Link="Common\System\Text\ValueStringBuilder.cs" />
  </ItemGroup>

  <ItemGroup Condition="'$(TargetFrameworkIdentifier)' != '.NETCoreApp'">
    <Compile Include="System\Diagnostics\Activity.GenerateRootId.netfx.cs" />
    <Compile Include="System\Diagnostics\ActivityContext.netfx.cs" />
    <Compile Include="System\Diagnostics\ActivityLink.netfx.cs" />
    <Compile Include="System\Diagnostics\Metrics\Instrument.netfx.cs" />
    <Compile Include="System\Diagnostics\Metrics\ObjectSequence.netfx.cs" />
    <Compile Include="System\Diagnostics\Metrics\StringSequence.netfx.cs" />

    <Compile Include="$(CoreLibSharedDir)System\Diagnostics\CodeAnalysis\DynamicallyAccessedMembersAttribute.cs" />
    <Compile Include="$(CoreLibSharedDir)System\Diagnostics\CodeAnalysis\DynamicallyAccessedMemberTypes.cs" />
    <Compile Include="$(CoreLibSharedDir)System\Diagnostics\CodeAnalysis\DynamicDependencyAttribute.cs" />
    <Compile Include="$(CoreLibSharedDir)System\Diagnostics\CodeAnalysis\RequiresDynamicCodeAttribute.cs" />
    <Compile Include="$(CoreLibSharedDir)System\Diagnostics\CodeAnalysis\RequiresUnreferencedCodeAttribute.cs" />
    <Compile Include="$(CoreLibSharedDir)System\Diagnostics\CodeAnalysis\UnconditionalSuppressMessageAttribute.cs" />
    <Compile Include="$(CoreLibSharedDir)System\Runtime\CompilerServices\IsExternalInit.cs" />
  </ItemGroup>

  <ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' or
                        '$(TargetFramework)' == 'netstandard2.0'">
    <Compile Include="System\Diagnostics\Activity.DateTime.corefx.cs" />
  </ItemGroup>

  <ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">
    <Compile Include="System\Diagnostics\HttpHandlerDiagnosticListener.cs" />
    <Compile Include="System\Diagnostics\Activity.DateTime.netfx.cs" />
  </ItemGroup>

  <ItemGroup Condition="'$(TargetFramework)' == '$(NetCoreAppCurrent)'">
    <Reference Include="System.Collections" />
    <Reference Include="System.Collections.Concurrent" />
    <Reference Include="System.Diagnostics.Tracing" />
    <Reference Include="System.Memory" />
    <Reference Include="System.Runtime" />
    <Reference Include="System.Runtime.InteropServices" />
    <Reference Include="System.Threading" />
    <Reference Include="System.Threading.Thread" />
  </ItemGroup>

  <ItemGroup Condition="'$(TargetFrameworkIdentifier)' != '.NETCoreApp'">
    <PackageReference Include="System.Memory" Version="$(SystemMemoryVersion)" />
    <PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="$(SystemRuntimeCompilerServicesUnsafeVersion)" />
  </ItemGroup>

</Project>
